package cn.wolfcode.wolf2w.controller;


import cn.wolfcode.wolf2w.JsonResult.JsonResult;
import cn.wolfcode.wolf2w.domain.Banner;
import cn.wolfcode.wolf2w.domain.Strategy;
import cn.wolfcode.wolf2w.domain.Travel;
import cn.wolfcode.wolf2w.query.BannerQuery;
import cn.wolfcode.wolf2w.service.IBannerService;
import cn.wolfcode.wolf2w.service.IDestinationService;
import cn.wolfcode.wolf2w.service.IStrategyService;
import cn.wolfcode.wolf2w.service.ITravelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/index")
public class IndexController {

    @Autowired
    private IBannerService bannerService;

    @GetMapping("/banners/travel")
    public Object bannerTravel(){
        List<Banner> list=bannerService.queryTravleBanner(Banner.TYPE_TRAVEL);
        return JsonResult.success(list);
    }
    @GetMapping("/banners/strategy")
    public Object bannerStrategy(){
        List<Banner> list=bannerService.queryStrategyBanner(Banner.TYPE_STRATEGY);
        return JsonResult.success(list.get(0));
    }
}
